<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no" />
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <style>
        html, body {
            background-color: #f8f8f8;
        }
        .box {
            display: -webkit-box;
            display: -webkit-flex;
            align-items: center;
            padding: 0 20px;
            background-color: #fff;
            color: #333;
            font-size: 15px;
        }
        .box .box_l {
            width: 54px;
        }
        .box .box_l img {
            width: 19px;
            display: block;
        }
        .address {
            height: 73px;
            padding-right: 22px;
            border-bottom: 1px solid #e8e8e8;
        }
        .address .box_l img {
            width: 19px;
        }
        .address .box_c {
            flex: 1;
            -webkit-flex: 1;
            box-flex: 1;
            -webkit-box-flex: 1;
            padding-right: 20px;
        }
        .address .box_c .address_box {
            overflow: hidden;
            text-overflow: ellipsis;
            display: box;
            display: -webkit-box;
            line-clamp: 2;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .address .box_r img {
            height: 36px;
            display: block;
        }
        .business_hours {
            height: 58px;
            margin-bottom: 6px;
        }
        .business_hours .box_l img {
            width: 23px;
        }
        .business_hours .box_r {
            flex: 1;
            -webkit-flex: 1;
            box-flex: 1;
            -webkit-box-flex: 1;
        }
        .distribution {
            height: 58px;
            margin-bottom: 6px;
        }
        .distribution .box_l img {
            width: 25px;
        }
        .distribution .box_r {
            flex: 1;
            -webkit-flex: 1;
            box-flex: 1;
            -webkit-box-flex: 1;
        }
        .activity {
            height: 80px;
        }
        .activity .box_l img {
            width: 23px;
        }
        .activity .box_r {
            flex: 1;
            -webkit-flex: 1;
            box-flex: 1;
            -webkit-box-flex: 1;
        }
        .activity .box_r .activity_box {
            font-size: 12px;
            color: #999;
            margin-top: 10px;
        }
        .activity .box_r .activity_box span {
            width: 16px;
            height: 16px;
            line-height: 16px;
            text-align: center;
            background-color: #ff5f78;
            color: #fff;
            display: inline-block;
            border-radius: 3px;
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="box address">
            <div class="box_l">
                <img src="../image/seller_icon1.png">
            </div>
            <div class="box_c">
                <div class="address_box"></div>
            </div>
            <div class="box_r">
                <img call="" onclick="fnCall(this);" tapmode src="../image/seller_icon5.png">
            </div>
        </div>
        <div class="box business_hours">
            <div class="box_l">
                <img src="../image/seller_icon2.png">
            </div>
            <div class="box_r">营业时间：<span class="begin_time"></span> - <span class="end_time"></span></div>
        </div>
        <div class="box distribution">
            <div class="box_l">
                <img src="../image/seller_icon3.png">
            </div>
            <div class="box_r">配送服务由Bit骑手提供</div>
        </div>
        <div class="box activity">
            <div class="box_l">
                <img src="../image/seller_icon4.png">
            </div>
            <div class="box_r">
                <div class="activity_p">进行的活动</div>
                <div class="activity_box"><span>减</span><time class="coupon_str"></time></div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script id="commentTpl" type="text/x-dot-template">
    {{ for(var i=0;i<it.length;i++){ }}
        <li>
            <div class="li_box">
                <div class="li_boxl">
                    <div class="li_img">
                        <img src="{{=formatVideoImg(it[i]['img'])}}">
                    </div>
                </div>
                <div class="li_boxr">
                    <div class="name">{{=it[i]['nickname']}}</div>
                    <div class="evaluate">
                        商品： 
                        {{if(it[i]['opinion'] == 1){ }}
                            <span class="evaluate_good">好评</span><img src="../image/evaluate_good.png">
                        {{ }else{ }}
                            <span class="evaluate_bad">差评</span><img src="../image/evaluate_bad.png">

                        {{ }; }}
                    </div>
                    <div class="evaluate_content">{{=it[i]['content']}}</div>
                    {{ if(it[i]['pictures']){ }}
                        <div class="goods_img_box">
                            {{for(var j=0;j<it[i]['pictures'].length;j++){ }}
                                <div class="goods_img">
                                    <img src="{{=formatVideoImg(it[i]['pictures'][j]['img'])}}">
                                </div>
                            {{ }; }}
                        </div>
                    {{ }; }}
                </div>
            </div>
        </li>
    {{ }; }}
</script>
<script type="text/javascript">
    apiready = function(){
        id = api.pageParam.id;
        api.ajax({
            url: rootPath + '/api/shop/shopInfo',
            method: 'get',
            cache : true,
            data: {
                values: { 
                    id: id
                },
                
            }
        }, function(ret, err) {
            if (ret) {
                if(ret.status == 200) {
                    $('.address_box').text(ret.data.address);
                    tel = ret.data.phone;
                    if(ret.data.begin_time) {
                        $('.begin_time').text(ret['data']['begin_time'].substr(0,5));
                    }
                    if(ret.data.end_time) {
                        $('.end_time').text(ret['data']['end_time'].substr(0,5));
                    }
                    $('.coupon_str').text(ret.data.coupon_str);
                }
            } 
        });
    };

    function fnCall(this_) {
        if(tel) {
            api.call({
                type: 'tel',
                number: '+'+tel
            });
        }else{
            api.toast({
                msg: '暂无商家联系方式',
                location : 'middle'
            });
        }
    }
</script>
</html>